import React, { Component } from 'react';


import Header from '../ui/header/Header'
import  Search from '@c/search/Search'
import ZtWrap from '../ui/zhuanti/ZhuanTi'
import { connect } from 'react-redux'
import { loadDataAsync } from '../actionCreator'
import  Car  from '../ui/carousel/Carousel'
import Grid from '../ui/grid/Grid'

@connect(
  (state) =>{
     return{
      list:state.frist.list
     }
  },
  (dispatch) =>({
    loadData(){
      dispatch(loadDataAsync())
    }
  })
    
)
class index extends Component {
  constructor(props) {
    super(props);
    this.state = {
    };
  }

  render() {
    return (
      <div>
      <Header></Header>
      <Car></Car>
      <Grid></Grid>
      <ZtWrap list={this.props.list}></ZtWrap>
      </div>
    );
  }
  componentDidMount(){
    this.props.loadData()
  }
  componentDidUpdate(){
    console.log(this.props.list);
  }
}

export default index